package com.bill99.rpc.registry;

import java.util.List;

import com.bill99.rpc.registry.url.ReferenceUrl;
import com.bill99.rpc.registry.url.ServiceUrl;


/**
 * 注册服务
 * @author sheng.zhang
 */
public interface RegistryService {

	/**
	 * 注册服务
	 * @param serviceUrl
	 */
	public void register(ServiceUrl serviceUrl);

	/**
	 * 删除注册的服务
	 * @param serviceUrl
	 */
	public void unregister(ServiceUrl serviceUrl);

	/**
	 * 订阅服务
	 * @param referenceUrl
	 * @param notifyListener
	 */
	public void subscribe(ReferenceUrl referenceUrl, NotifyListener notifyListener);

	/**
	 * 删除订阅的服务
	 * @param referenceUrl
	 * @param notifyListener
	 */
	public void unsubscribe(ReferenceUrl referenceUrl, NotifyListener notifyListener);

	/**
	 * 查找服务
	 * @param referenceUrl
	 * @return
	 */
	public List<ServiceUrl> lookup(ReferenceUrl referenceUrl);
}
